import 'package:enterprise_v6_app/generated/json/base/json_convert_content.dart';
import 'package:enterprise_v6_app/app/data/entities/application/emergency/all_drill_entity.dart';

AllDrillEntity $AllDrillEntityFromJson(Map<String, dynamic> json) {
  final AllDrillEntity allDrillEntity = AllDrillEntity();
  final int? planDemonstrationNum = jsonConvert.convert<int>(json['planDemonstrationNum']);
  if (planDemonstrationNum != null) {
    allDrillEntity.planDemonstrationNum = planDemonstrationNum;
  }
  final int? collaborativeExerciseNum = jsonConvert.convert<int>(json['collaborativeExerciseNum']);
  if (collaborativeExerciseNum != null) {
    allDrillEntity.collaborativeExerciseNum = collaborativeExerciseNum;
  }
  final int? inferenceReviewNum = jsonConvert.convert<int>(json['inferenceReviewNum']);
  if (inferenceReviewNum != null) {
    allDrillEntity.inferenceReviewNum = inferenceReviewNum;
  }
  final int? lastYearPlanDemonstrationNum = jsonConvert.convert<int>(json['lastYearPlanDemonstrationNum']);
  if (lastYearPlanDemonstrationNum != null) {
    allDrillEntity.lastYearPlanDemonstrationNum = lastYearPlanDemonstrationNum;
  }
  final int? lastYearCollaborativeExerciseNum = jsonConvert.convert<int>(json['lastYearCollaborativeExerciseNum']);
  if (lastYearCollaborativeExerciseNum != null) {
    allDrillEntity.lastYearCollaborativeExerciseNum = lastYearCollaborativeExerciseNum;
  }
  final int? lastYearInferenceReviewNum = jsonConvert.convert<int>(json['lastYearInferenceReviewNum']);
  if (lastYearInferenceReviewNum != null) {
    allDrillEntity.lastYearInferenceReviewNum = lastYearInferenceReviewNum;
  }
  return allDrillEntity;
}

Map<String, dynamic> $AllDrillEntityToJson(AllDrillEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['planDemonstrationNum'] = entity.planDemonstrationNum;
  data['collaborativeExerciseNum'] = entity.collaborativeExerciseNum;
  data['inferenceReviewNum'] = entity.inferenceReviewNum;
  data['lastYearPlanDemonstrationNum'] = entity.lastYearPlanDemonstrationNum;
  data['lastYearCollaborativeExerciseNum'] = entity.lastYearCollaborativeExerciseNum;
  data['lastYearInferenceReviewNum'] = entity.lastYearInferenceReviewNum;
  return data;
}

extension AllDrillEntityExtension on AllDrillEntity {
  AllDrillEntity copyWith({
    int? planDemonstrationNum,
    int? collaborativeExerciseNum,
    int? inferenceReviewNum,
    int? lastYearPlanDemonstrationNum,
    int? lastYearCollaborativeExerciseNum,
    int? lastYearInferenceReviewNum,
  }) {
    return AllDrillEntity()
      ..planDemonstrationNum = planDemonstrationNum ?? this.planDemonstrationNum
      ..collaborativeExerciseNum = collaborativeExerciseNum ?? this.collaborativeExerciseNum
      ..inferenceReviewNum = inferenceReviewNum ?? this.inferenceReviewNum
      ..lastYearPlanDemonstrationNum = lastYearPlanDemonstrationNum ?? this.lastYearPlanDemonstrationNum
      ..lastYearCollaborativeExerciseNum = lastYearCollaborativeExerciseNum ?? this.lastYearCollaborativeExerciseNum
      ..lastYearInferenceReviewNum = lastYearInferenceReviewNum ?? this.lastYearInferenceReviewNum;
  }
}
